package com.Sing.Service;

import com.Sing.Dao.ReaderMapper;
import com.Sing.Pojo.Reader;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;

import java.util.ArrayList;
import java.util.HashMap;

public class ReaderServiceImpl implements ReaderService {
    private ReaderMapper mapper;
    @Autowired
    public void setMapper(ReaderMapper mapper) {
        this.mapper = mapper;
    }

    @Override
    public Reader getDataByCheck(String username, String password) {
        return mapper.getDataByCheck(username, password);
    }

    @Override
    public ArrayList<Reader> getAllData(HashMap<String, Object> paramMap) {
        return mapper.getAllData( paramMap );
    }

    @Override
    public int getContext(HashMap<String, Object> paramMap) {
        return mapper.getContext( paramMap );
    }

    @Override
    public boolean updateData(HashMap<String, Object> paramMap) {
        return mapper.updateData( paramMap );
    }

    @Override
    public Reader queryReaderById(int id) {
        return mapper.queryReaderById( id );
    }

    @Override
    public boolean addReader(Reader reader) {
        return mapper.addReader( reader );
    }

    @Override
    public boolean deleteReader(int id) {
        return mapper.deleteReader( id );
    }

    @Override
    public Reader queryReaderByReaderNumber(String readerNumber) {
        return mapper.queryReaderByReaderNumber( readerNumber );
    }
}
